package cn.k23.bymain.bean.sys;

import cn.k23.bymain.common.validation.group.Login;
import cn.k23.bymain.common.validation.group.Modify;
import cn.k23.bymain.common.validation.group.Save;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Description:
 * @Author: k23
 * @Date: 2022-05-09 9:54
 * @Version: 1.0
 */
@Data

@ApiModel(value = "User",description = "保存用户时传递的参数")
//Swappper注解

public class User {
    @ApiModelProperty(value = "id",notes = "id",required = false)//Swappper注解
    int id;

    @ApiModelProperty(value = "书籍名称",notes = "书籍",required = true)//Swappper注解
    @NotBlank(message = "书籍名称不能为空!",groups = {Save.class, Modify.class, Login.class}) //校验参数注解 @NotBlank有空格的空字符串 不允许
    String name;

    @NotBlank(message = "作者名称不能为空!",groups = {Save.class, Modify.class, Login.class}) //校验参数注解
    @ApiModelProperty(value = "作者名称",notes = "作者",required = true)//Swappper注解
    String author;
}
